package com.bjpowernode.beans;

import java.util.Objects;

public class Stu {
    int id;
    String name;
    String age;
    float score;
    String sex;
    ClassRoom calssRoom;

    public Stu() {
    }

    public Stu(int id, String name, String age, float score, String sex, ClassRoom calssRoom) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.score = score;
        this.sex = sex;
        this.calssRoom = calssRoom;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public float getScore() {
        return score;
    }

    public void setScore(float score) {
        this.score = score;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public ClassRoom getCalssRoom() {
        return calssRoom;
    }

    public void setCalssRoom(ClassRoom calssRoom) {
        this.calssRoom = calssRoom;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Stu stu = (Stu) o;
        return id == stu.id && Float.compare(stu.score, score) == 0 && Objects.equals(name, stu.name) && Objects.equals(age, stu.age) && Objects.equals(sex, stu.sex) && Objects.equals(calssRoom, stu.calssRoom);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, age, score, sex, calssRoom);
    }

    @Override
    public String toString() {
        return "Stu{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", score=" + score +
                ", sex='" + sex + '\'' +
                ", calssRoom=" + calssRoom +
                '}';
    }
}
